package com.itcast.spring6.aop.api;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;

/**
 * @author zhangtian105
 * @date 2023/5/11
 * @apiNote
 */
@Slf4j
@Component(value = "helloWorldServiceImpl")
public class HelloWorldServiceImpl implements HelloWorldService {
    @Override
    public String helloWorld(String say) {
        log.info("spring.HelloWorldServiceImpl.helloWorld, say: {}", say);
        return "hello world";
    }

    @Override
    public String testThis(String what) {
        log.info("what testThis ......");

        try {
            Thread.sleep(1000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        return this.what(what);
    }

    public String what(String say) {

        try {
            Thread.sleep(3000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }

        log.info("what business ...... {}", say);
        return "you say what ? " + say ;
    }
}
